博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
弹出提示框,大面板
阅读量:5346 次
发布时间:2019-06-15

本文共 8957 字,大约阅读时间需要 29 分钟。

function openalert(txt, lisneter, parent,title) {    var p = parent || 'body';    var bg = $('
').appendTo(p); bg.css({ position: 'fixed', top: '0px', left: '0px', width: '100%', height: '100%', backgroundColor: "#000", opacity: 0 }); var rame = $('
').appendTo(p); var ramedraw = rame.draw("xy",".head_t"); if ($.browser.msie) { if ($.browser.version == 7){ rame.css({ width: '300px' }); } else if ($.browser.version == 6){ $w = $(window); var s = $w.scrollTop(); rame.css({ width: '300px', position: 'absolute',top:($w.height() - rame.height()) / 2+s }); bg.css({ position: 'absolute', height: $w.height(), width: $w.width(),top:s}); $w.scroll(function () { var s = $w.scrollTop(); var t = ($w.height() - rame.height()) / 2 + s; bg.css({ top: s }); rame.css({ top: t }); }); } } rame.find(".head_t a.close").click(function () { close(); if (lisneter && typeof (lisneter.onclose) === 'function') lisneter.onclose(); }); rame.find(".footer a.ok").click(function () { close(); if (lisneter && typeof (lisneter.onok) === 'function') lisneter.onok(); }); rame.find(".footer a.cancel").click(function () { close(); if (lisneter && typeof (lisneter.oncancel) === 'function') lisneter.oncancel(); }); rame.find(".footer a.agree").click(function () { close(); if (lisneter && typeof (lisneter.onagree) === 'function') lisneter.onagree(); }); rame.find(".footer a.refuse").click(function () { close(); if (lisneter && typeof (lisneter.onrefuse) === 'function') lisneter.onrefuse(); }); if (lisneter && typeof (lisneter.oncancel) === 'function') { rame.find(".footer a.cancel").css({display:'inline-block'}); } if (lisneter && typeof (lisneter.onok) === 'function') { rame.find(".footer a.ok").css({display:'inline-block'}); } if (lisneter && typeof (lisneter.onagree) === 'function') { rame.find(".footer a.agree").css({display:'inline-block'}); } if (lisneter && typeof (lisneter.onrefuse) === 'function') { rame.find(".footer a.refuse").css({display:'inline-block'}); } if (lisneter && lisneter.noicon) { rame.css({ background: "#fff" }); rame.find('.content').css({ marginLeft: '0px' }); } var close = function (b) { ramedraw.unload(); rame.animate({ opacity: 0 }, function () { rame.remove(); }); bg.animate({ opacity: 0 }, function () { bg.remove(); }); }; var w = rame.width(); var h = rame.height(); rame.css({ marginLeft: "-" + w / 2 + 'px', marginTop: '-' + (h / 2 + 30) + 'px' }); if(parent){ var $parent = $(parent) $parent.css({position:'relative'}); bg.css({width:'100%',height:'100%',top:0,left:0,position:'absolute'}); rame.css({position:'absolute'}); } bg.animate({ opacity: 0.4 }, 300); rame.fadeIn(); rame.close = close; return rame;}/*弹出一个大面板*/function openpanel(title, selector, lisneter) { var bg = $('
').appendTo("body"); bg.css({ position: 'fixed', top: '0px', left: '0px', width: '100%', height: '100%', backgroundColor: "#000", opacity: 0 }); var rame = $('
').appendTo("body"); //var rameobj = rame.draw("xy",".head_t"); rame[0].id = rame[0].id + selector.substr(1); var content = $(selector); var parent = content.parent(); if (lisneter.hasLoad) { rame.children('.content').css('background', 'url(/images/openloading.gif) no-repeat center center'); content.css('visibility', 'hidden'); } rame.children('.content').append(content[0]); if($.browser.msie){ if($.browser.version == 7||$.browser.version == 8){ rame.css({width:content.width()+60+'px'}); } else if($.browser.version == 6){ $("body").css({height:'100%',width:'100%'}); bg.css({position:'absolute'}); rame.css({position:'absolute'}); rame.css({width:content.width()+60+'px'}); } } rame.find(".head_t a.close").click(function(){ close(); if(lisneter && typeof(lisneter.onclose) === 'function') lisneter.onclose(); }); rame.find(".footer a.ok").click(function(){ close(); if(lisneter && typeof(lisneter.onok) === 'function') lisneter.onok(); }); rame.find(".footer a.cancel").click(function(){ close(); if(lisneter && typeof(lisneter.oncancel) === 'function') lisneter.oncancel(); }); rame.find(".footer a.agree").click(function(){ close(); if(lisneter && typeof(lisneter.onagree) === 'function') lisneter.onagree(); }); rame.find(".footer a.refuse").click(function(){ close(); if(lisneter && typeof(lisneter.onrefuse) === 'function') lisneter.onrefuse(); }); if(lisneter && typeof(lisneter.oncancel) === 'function'){ rame.find(".footer a.cancel").css({display:'inline-block'}); } if(lisneter && typeof(lisneter.onok) === 'function'){ rame.find(".footer a.ok").css({display:'inline-block'}); } if(lisneter && typeof(lisneter.onagree) === 'function'){ rame.find(".footer a.agree").css({display:'inline-block'}); } if(lisneter && typeof(lisneter.onrefuse) === 'function'){ rame.find(".footer a.refuse").css({display:'inline-block'}); } if(lisneter && lisneter.noicon){ rame.css({background:"#fff"}); rame.find('.content').css({marginLeft:'0px'}); } var close = function (f) { //rameobj.unload(); if (content.attr("iframe") && content.attr("iframe") != '') content.empty(); parent.append(content); win.unbind('resize', resbox); bg.remove(); rame.remove(); /* rame.animate({opacity:0},function(){ parent.append(content); rame.remove(); if(typeof(f) == 'function') f(); }); bg.animate({opacity:0},function(){ bg.remove(); }); */ } var win = $(window); if (content.attr("iframe") && content.attr("iframe") != '') { var frameHeight = content.attr('frameHeight'); var src = content.attr("iframe"); content.empty(); src = src.indexOf("?") > 0 ? src + "&t=" + new Date : src + "?t=" + new Date(); content.append('

 

转载于:https://www.cnblogs.com/wwqianduan/p/3494378.html

你可能感兴趣的文章
字母和数字键的键码值(keyCode)
查看>>
IE8调用window.open导出EXCEL文件题目
查看>>
Spring mvc初学
查看>>
有意思的代码片段
查看>>
C8051开发环境
查看>>
VTKMY 3.3 VS 2010 Configuration 配置
查看>>
01_1_准备ibatis环境
查看>>
windows中修改catalina.sh上传到linux执行报错This file is needed to run this program解决
查看>>
JavaScript中的BOM和DOM
查看>>
360浏览器兼容模式 不能$.post (不是a 连接 onclick的问题!!)
查看>>
spring注入Properties
查看>>
【BZOJ-1055】玩具取名 区间DP
查看>>
Bit Twiddling Hacks
查看>>
LeetCode : Reverse Vowels of a String
查看>>
时间戳与日期的相互转换
查看>>
jmeter(五)创建web测试计划
查看>>
python基本数据类型
查看>>
1305: [CQOI2009]dance跳舞 - BZOJ
查看>>
关于TDD的思考
查看>>
Cocos2d-x学习之windows 7 android环境搭建
查看>>